<template>
<div>
<el-row>
	<el-col :span="8">
      <el-input v-model="text" placeholder="请输入内容"></el-input> 	
	</el-col>
	<el-col :span="24">	
	  <el-button>默认按钮</el-button>
	  <el-button type="primary" @click="onClickSnowflak">雪花</el-button>
	  <el-button type="success" @click="onClick">MD5</el-button>
	  <el-button type="info" @click="onClickQuery">query参数</el-button>
	  <el-button type="warning">警告按钮</el-button>
	  <el-button type="danger">危险按钮</el-button>
	</el-col>
</el-row>
</div>
</template>

<script>

import request from '@/router/axios';
import { baseUrl } from '@/config/env';

export default {
  data(){
    return {
      text: ''
    }
  },
  methods: {
      onClick(){
        request({
            method: 'get',
            url: baseUrl + `/api/md5/${this.text}`,         
            })
            .then((res)=> {
			    this.text = res.data;
        })       
      },
	  onClickSnowflak(){
		  request({
			  method: 'get',
		      url: baseUrl + 'api/Snowflak/1'
		  }).then((res)=> {
			 this.text = res.data.data[0];  
		  })
	  },
	  onClickQuery(){
		  this.text = this.$route.query.table;
	  }
  }
}
</script>

<style>
</style>
